package com.kabuda.zhugehot200;

import java.util.LinkedList;
import java.util.Queue;

/**
 * @author kabuda
 * @date 2025-03-24 22:06
 * @description
 */
public class t649_Dota2参议院 {
    public static void main(String[] args) {

    }


    public String predictPartyVictory(String senate) {
        Queue<Integer> rQueue = new LinkedList();
        Queue<Integer> dQueue = new LinkedList();
        for (int i = 0; i < senate.toCharArray().length; i++) {
            char c = senate.charAt(i);
            if (c == 'R') {
                rQueue.offer(i);
            } else {
                dQueue.offer(i);
            }
        }

        while (!rQueue.isEmpty() && !dQueue.isEmpty()) {
            Integer r = rQueue.poll();
            Integer d = dQueue.poll();
            if (r < d) {
                rQueue.offer(r + senate.length());
            }else{
                dQueue.offer(d + senate.length());
            }
        }
        return dQueue.isEmpty() ? "Radiant" : "Dire";

    }
}
